package com.primb.bench.project.approval.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.primb.bench.R;
import com.primb.bench.base.BaseFragment;
import com.primb.bench.project.approval.activity.ApprovalActivity;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;

/**
 * Created by Chen on 2017/4/17.
 * 功能描述：
 */

public class ApprovalFragment extends BaseFragment {

    @BindView(R.id.tv_approval_wait)
    TextView tvApprovalWait;
    @BindView(R.id.tv_approval_title)
    TextView tvApprovalTitle;

    @Override
    protected int onBaseLayoutId() {
        return R.layout.fragment_approval;
    }

    @Override
    protected void onBaseBindView() {
        int statusBarHeight = -1;
        //获取status_bar_height资源的ID
        int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android");
        if (resourceId > 0) {
            //根据资源ID获取响应的尺寸值
            statusBarHeight = getResources().getDimensionPixelSize(resourceId);
            RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
            layoutParams.setMargins(0, statusBarHeight + 12, 0, 0);
//            tvApprovalTitle.setTextSize(18);
            tvApprovalTitle.setLayoutParams(layoutParams);
        }
    }

    @Override
    protected void onBaseLoadData() {

    }

    @OnClick({R.id.tv_approval_wait})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.tv_approval_wait:
                getActivity().startActivity(new Intent(getActivity(), ApprovalActivity.class));
                break;
        }
    }
}
